package dome1;


/* class Base{
     public int a = 9;
     public int b = 99;

 }
 class Der extends Base{
     public int a = 88;//同名情况下,看子类有没有,优先访问子类的
     public void method(){
         System.out.println("a"+a);
         System.out.println("b"+b);
     }
 }
*/
class Base {
    int a =99;
    public void method() {
        System.out.println("B:method()");
    }
}
class Der extends Base{
    int a=199;
    public void method2(){
        System.out.println("Der:method()");
    }
    public void method() {
        System.out.println("Der:method()");
    }
    public void test(){
        super.method();//调用父类方法
        method2();
        System.out.println(a);

        System.out.println(this.a);
        System.out.println(super.a);
    }

}

public class Test2 {
    public static void main(String[] args) {
        Der der = new Der();
        der.test();
    }
}
